<?php
session_start();//开启session
?>
<!DOCTYPE html>
<html>
    <head>
        <title>登录界面</title>
        <meta charset="utf-8" />
        <link type="text/css" rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />
        <script type="text/javascript" src="../bootstrap/js/jquery-1.9.1.min.js"></script>
        <script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
        <style type="text/css">
            .panel{
	            width: 400px;
            	height: 300px;
            	margin: auto;
            }
            .form-group span{
	            display: block;
            	height: 20px;
            	color: red;
            }
        </style>
    </head>
    <body>
        <br/><br/><br/><br/>
        <br/><br/><br/>
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">登录</h3>
            </div>
            <div class="panel-body">
                <form action="../index.php" method="get">
                    <input type="hidden" name="c" value="User"/>
                    <input type="hidden" name="a" value="login"/>
                    <div class="form-group">
                        <label>用户名</label>
                        <input type="text" name="userName" class="form-control" placeholder="用户名" />
                        <span>
                        <?php 
                        if(isset($_SESSION["errorMsg"]) && $_SESSION["errorMsg"] == 1){
                            echo "用户名不存在！";
                            unset($_SESSION["errorMsg"]);
                        }
                        ?>
                        </span>
                    </div>
                    <div class="form-group">
                        <label>密码</label>
                        <input type="password" name="userPass" class="form-control" placeholder="密码" />
                        <span>
                        <?php 
                        if(isset($_SESSION["errorMsg"]) && $_SESSION["errorMsg"] == 2){
                            echo "密码错误！";
                            unset($_SESSION["errorMsg"]);
                        }
                        ?>
                        </span>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary">登录</button>
                    </div>
                </form>
            </div>
        </div>
    </body>
</html>